//
//  GetHeightTools.m
//  UI12_homework_网易
//
//  Created by aaaaaa on 16/6/22.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "GetHeightTools.h"

@implementation GetHeightTools

+ (CGFloat)getTextHeight:(NSString *)text{
    NSDictionary *dic = @{
                          NSFontAttributeName : [UIFont systemFontOfSize:17]
                          };
    
    CGRect rect = [text boundingRectWithSize:CGSizeMake([UIScreen mainScreen].bounds.size.width - 10, 1000) options:NSStringDrawingUsesLineFragmentOrigin attributes:dic context:nil];
    return rect.size.height;
                          
}

+ (CGFloat)getImageHeight:(NSString *)imageName{
    NSURL *imageURL = [NSURL URLWithString:imageName];
    UIImage *image = [UIImage imageWithData:[NSData dataWithContentsOfURL:imageURL]];
    CGFloat imageHeight = image.size.height / image.size.width * [UIScreen mainScreen].bounds.size.width;
    return imageHeight;
}



@end
